<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>呼叫云</title>
    <link rel="shortcut icon" href="../img/logox_circle.png">
    <link rel="stylesheet" href="../css/pintuer.css">
    <link rel="stylesheet" href="../css/admin.css">
	<script src="../js/jquery-1.11.0.min.js"></script> 
	<script src="../js/fenye.js"></script>
	<script src="../js/config.js"></script> 
	<script>
		$(function(){
			$("#showName").val("tasks1");
		});
		//textarea onfocus事件
		function noPrompt(){
			 $("#prompt").css("display","none");
		}
		//审核
		function toExamine(taskID,status){
			if(status == 9){//审核不通过
				var verifyFailReason = $("#verifyFailReason").val();
				if(verifyFailReason!=""){
					location.href=serviceConfig.task.updateTaskStatus+"?taskID="+taskID+"&status="+status+"&verifyFailReason="+verifyFailReason;
				}else{
					$("#prompt").css("display","");
				}
			}else if(status==8){//审核通过
				location.href=serviceConfig.task.updateTaskStatus+"?taskID="+taskID+"&status="+status;
			}
		}
		//返回
		function goback(){
			var url='${url}';
			var goBackType = '${goBackType}';
			if(goBackType==0){//返回上一页
				location.href=history.go(-1);
			}else{
				location.href=serviceConfig.task.getTaskList+url;
			}
		}
		//下载文件
		function filedownload(filePath,fileName){
			fileName = fileName+filePath.substr(filePath.lastIndexOf("."));
			//console.log(fileName);
			location.href=serviceConfig.file.filedownload+"?filePath="+filePath+"&fileName="+fileName;
			
		}
	</script>
</head>

<body>
<div class="lefter">
    <div class="logo"><a href="#" target="_blank"><img style="width:100%;" src="../img/logo3.png" alt="呼叫云后台管理系统" /></a></div>
</div>
<div class="righter nav-navicon" id="admin-nav">
    <div class="mainer">
        <div class="admin-navbar">
            <span class="float-right">
            	<span id="user_name"></span>
                <a class="button button-little bg-yellow" href="login">注销登录</a>
            </span>
            <#include "../common/head.ftl"> 
        </div>
        <div class="admin-bread">
            <ul class="bread">
                <li><a class="icon-user"> 任务管理</a></li>
                <li><a>企业任务</a></li>
				<li>企业任务详情</li>
            </ul>
        </div>
    </div>
</div>
<div class="admin">
	<a href="#" onclick="goback()"><<返回</a>
		<div class="line-big" style="margin-top:10px;">
            <div class="panel" style="width:90%;">
            	<div class="panel-head"><strong>企业任务详细信息</strong></div>
                <table class="table">
                    <tr>
						<td width="90" align="right">任务名称：</td>
						<td width="300">${taskMap.title}</td>
						<td width="90" align="right">任务描述：</td>
						<td width="300">${taskMap.desc}</td>
					</tr>
					<tr>
						<td width="90" align="right">发布企业：</td>
						<td width="300">${taskMap.loginName}</td>
						<td width="90" align="right">企业名称：</td>
						<td width="300">${taskMap.entName}</td>
					</tr>
					<tr>
						<td width="90" align="right">企业账户余额：</td>
						<td width="300">${taskMap.balance}</td>
						<td width="90" align="right">任务呼叫类型：</td>
						<td width="300">
							<#if taskMap.callType==1 >
								外呼
							<#elseif taskMap.callType==2 >
								综合
							<#else>
							
							</#if>
						</td>
					</tr>
					<tr>
						<td width="90" align="right">任务时间类型：</td>
						<td width="300">
							<#if taskMap.durType==1 >
								长期
							<#elseif taskMap.durType==2 >
								短期
							<#else>
							
							</#if>
						</td>
						<td width="90" align="right">任务分类：</td>
						<td width="300">${taskMap.taskTypes}</td>
					</tr>
					<tr>
						<td width="90" align="right">在线时长报酬：</td>
						<td width="300">${taskMap.onlinePay}</td>
						<td width="90" align="right">成单报酬：</td>
						<td width="300">${taskMap.poPay}</td>
					</tr>
					<tr>
						<td width="90" align="right">接听报酬：</td>
						<td width="300">${taskMap.callinPay}</td>
						<td width="90" align="right">外呼报酬：</td>
						<td width="300">${taskMap.calloutPay}</td>
					</tr>
					<tr>
						<td width="90" align="right">任务状态：</td>
						<td width="300">${taskMap.status}</td>
						<td width="90" align="right">进行状态：</td>
						<td width="300">
							<#if taskMap.runstatus==0 >
								未开始
							<#elseif taskMap.runstatus==1 >
								已开始
							<#else>
							
							</#if>
						</td>
					</tr>
					<#if taskMap.statusID == 9 >
						<tr>
							<td width="90" align="right">审核未通过原因：</td>
							<td  colspan = "3">${taskMap.verifyFailReason}</td>
						</tr>
					</#if>
					<tr>
						<td width="90" align="right">创建时间：</td>
						<td width="300">${taskMap.createTime}</td>
						<td width="90" align="right">修改时间：</td>
						<td width="300">${taskMap.updateTime}</td>
					</tr>
					<tr>
						<td width="90" align="right">任务开始时间：</td>
						<td width="300">${taskMap.beginTime}</td>
						<td width="90" align="right">任务结束时间：</td>
						<td width="300">${taskMap.endTime}</td>
					</tr>
					<tr>
						<td width="90" align="right">任务使用金额：</td>
						<td width="300">${taskMap.money}</td>
						<td width="90" align="right">客服数量(已招/需要)：</td>
						<td width="300">${taskMap.csHave}/${taskMap.csNeed}</td>
					</tr>
					<tr>
						<td width="90" align="right">全部外呼数量：</td>
						<td width="300">${taskMap.calloutNum}</td>
						<td width="90" align="right">全部内呼数量：</td>
						<td width="300">${taskMap.callinNum}</td>
					</tr>
					<tr>
						<td width="90" align="right">呼出平均时长(小时)：</td>
						<td width="300">${taskMap.calloutAveDuration}</td>
						<td width="90" align="right">呼入平均时长(小时)：</td>
						<td width="300">${taskMap.callinAveDuration}</td>
					</tr>
					<tr>
						<td width="90" align="right">总机号码：</td>
						<td width="300">${taskMap.ims}</td>
						<td width="90" align="right">总机密码：</td>
						<td width="300">${taskMap.imsPasswd}</td>
					</tr>
					<tr>
						<td width="90" align="right">是否申请外显号码：</td>
						<td width="300">
						<#if taskMap.explicitApplyFile != "" >
							是 <a href="#" onclick="filedownload('${taskMap.explicitApplyFile}','${taskMap.title}')" style="font-size:10px;color:#0099CC"><下载申请外显号码资料></a>
						<#else>
							否
						</#if>
						</td>
						<td width="90" align="right">结算方式：</td>
						<td width="300">${taskMap.settleAccountWayStr}</td>
					</tr>
				</table>
            </div>	
    </div>
    
    <#if (taskMap.workTimeList?size > 0) >
			<div class="line-big" style="margin-top:10px;">
		            <div class="panel" style="width:90%;">
		            	<div class="panel-head"><strong>企业任务工作时间</strong></div>
		                <table class="table" >
		                    <tr style="font-weight:bold">
		                    	<td width="16%">序号</td>
								<td width="21%">开始时间</td>
								<td width="21%">结束时间</td>
								<td width="21%">时间段排序</td>
								<td width="21%">备注</td>
							</tr>
							 <#list taskMap.workTimeList as worktimes>
									<tr>
										<td>${worktimes_index+1}</td>
										<td>${worktimes.beginHour}</td>
										<td>${worktimes.endHour}</td>
										<td>${worktimes.section}</td>
										<td>${worktimes.remark}</td>
									</tr>
							</#list>
						</table>
		            </div>	
		    </div>
	 </#if>   
	
	    <#if (taskMap.userList?size > 0) >
			<div class="line-big" style="margin-top:10px;">
		            <div class="panel" style="width:90%;">
		            	<div class="panel-head"><strong>企业任务客服信息</strong></div>
		                <table class="table" >
		                    <tr style="font-weight:bold">
								<td width="60">序号</td>
								<td width="80">姓名</td>
								<td width="100">手机号</td>
								<td width="60">性别</td>
								<td width="60">信誉</td>
								<td width="60">经验值</td>
								<td width="60">等级</td>
								<td width="100">语种</td>
								<td width="160">擅长</td>
							</tr>
							<#list taskMap.userList as userMap>
								<tr>
									<td>${userMap_index+1}</td>
									<td>${userMap.name}</td>
									<td>${userMap.phone}</td>
									<td>${userMap.sex}</td>
									<td>${userMap.rate}</td>
									<td>${userMap.workHour}</td>
									<td>${userMap.level}</td>
									<td>${userMap.language}</td>
									<td>${userMap.cstag}</td>
								</tr>
							</#list>
						</table>
		            </div>	
		    </div>
      </#if>
	
	 <#if taskMap.statusID==7 >
				<div class="form-group" style="padding-top:20px;width:90%;">
	                <div class="label"><label for="readme">审核不通过原因：</label></div>
	                <div class="field">
						<textarea id="verifyFailReason" onfocus="noPrompt()" class="input" rows="5" cols="50" placeholder="请填写审核不通过原因" ></textarea>
	                </div>
	            </div>
	            <div id="prompt" class="alert alert-yellow" style="width:90%;display:none;">不通过原因不能为空！</div>
				<div style="padding-top:20px;width:90%;text-align:center;">
	            	<a class="button bg-main" href="#" onclick="toExamine('${taskID}','8')" style="margin-left:80px;"> 审核通过</a> 
	            	<a class="button border-main" href="#" onclick="toExamine('${taskID}','9')" style="margin-left:80px;"> 审核不通过</a>
	            </div>
			</#if>				
</div>
</body>
</html>